/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/8/31
 * Time: 22:57
 */
public class Solution {
    public boolean isUnique(String str) {
        if (str.length() > 26) return false;
        int bitMap = 0;
        for (int i = 0; i < str.length(); i++) {
            int x = str.charAt(i) - 'a';
            //判断字符是否在位图中
            if (((bitMap >> x) & 1) == 1){
                return false;
            }
            //将当前字符加入到位图中
            bitMap |= (1 << x);
        }
        return true;
    }
    public static void main(String[] args) {
        Solution solution = new Solution();
        boolean flg = solution.isUnique("abc");
        System.out.println(flg);
    }
}